﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using Interfaces;


namespace TestApplication3
{
    public class TestApplication3 : IApplication
    {
        public ContextMatchesHandler ContextMatches;
        
        public TestApplication3()
		{
		
            // Add constructor logic here
            mainInterface = new ctlMain(this);
            ContextMatches = new ContextMatchesHandler(this.ReminderEventHandler);
		}
		
		//Declarations of all our internal plugin variables
		string name = "Reminder";
        string description = "Location based reminder";
		string author = "Kiss Mátyás";
		string version = "0.0.1";
		IMiddleware host = null;
		System.Windows.Forms.UserControl mainInterface;
		
		/// <summary>
		/// Description of the Plugin's purpose
		/// </summary>
		public string Description
		{
            get { return description; }
		}

		/// <summary>
		/// Author of the plugin
		/// </summary>
		public string Author
		{
            get { return author; }
		}

		/// <summary>
		/// Host of the plugin.
		/// </summary>
		public IMiddleware Host
		{
            get { return host; }
            set { host = value; }
		}

		/// <summary>
		/// Name of the plugin.
		/// </summary>
        public string Name
		{
            get { return name; }
		}

		public System.Windows.Forms.UserControl MainInterface
		{
            get { return mainInterface; }
		}

		public string Version
		{
            get { return version; }
		}
		
		public void Initialize()
		{
			//This is the first Function called by the host...
			//Put anything needed to start with here first
		}
		
		public void Dispose()
		{
			//Put any cleanup code in here for when the program is stopped
		}

        public void ReminderEventHandler(object sender, int id, short relevance)
        {
            System.Windows.Forms.MessageBox.Show("event fired, relevance: " + relevance);
            host.RemoveEvent(id);
            
        }
       
    }
}
